package com.kaigejava.guanchazhemoshi.observermodel;

/**
 * Created by kaigejava on 2019/8/12.
 * 测试类
 */
public class ObserverWeatherMainTest {
    public static void main(String[] args) {
        CurrentConditionSt mCurrentConditions;
        ForcastConditionSt mForcastConditions;
        WeatherDataSt mWeatherDataSt;

        mWeatherDataSt=new WeatherDataSt();
        mCurrentConditions=new CurrentConditionSt();
        mForcastConditions=new ForcastConditionSt();

        mWeatherDataSt.registerObserver(mCurrentConditions);
        mWeatherDataSt.registerObserver(mForcastConditions);

        mWeatherDataSt.setData(30, 150, 40);
        mWeatherDataSt.removeObserver(mCurrentConditions);
        mWeatherDataSt.setData(40, 250, 50);
    }
}
